//
//  failToSendView.m
//  ZITHER
//
//  Created by weixin on 2018/9/29.
//  Copyright © 2018年 weixn. All rights reserved.
//

#import "failToSendView.h"
#import "Ugc_ReleaseFailure_VC.h"
@implementation failToSendView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = baseColorBackgroundError;
        [self addSubview:self.btn];

        [self.btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self).offset(0);
            make.width.mas_equalTo(kScreenW);
            make.height.mas_equalTo(45);
        }];
    }
    return self;
}

-(void)beginRefreshing{
   
}

-(QMUIButton *)btn{
    if (!_btn) {
        _btn = [[QMUIButton alloc]initWithFrame:CGRectMake(0,0,kScreenW,45)];
        _btn.titleLabel.font  = [UIFont systemFontOfSize:12];
        [_btn setTitle:@"内容发布失败,点击查看详情" forState: UIControlStateNormal];
        [_btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _btn.backgroundColor = baseColorBackgroundError;
        @weakify(self);
        [[_btn rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self);
            Ugc_ReleaseFailure_VC *vc = [[Ugc_ReleaseFailure_VC alloc]init];
            [self.getNav pushViewController:vc animated:YES];
        }];
    }
    return _btn;
}
@end
